const globalModules = {
  state: {
    globalData: {},
    contentData: {},
    colorPrimary: '#3254FD',
    colorSuccess: '#38D182',
    transitionName: ''
  },
  getters: {
    iconPath: state => state.iconPath,
    globalData: state => state.globalData,
    contentData: state => state.contentData,
    colorPrimary: state => state.colorPrimary,
    colorSuccess: state => state.colorSuccess,
    transitionName: state => state.transitionName,
    loginUrl: state => state.loginUrl
  },
  mutations: {
    setGlobalData(state, data) {
      state.globalData = { ...state.globalData, ...data }
    },
    resetGlobalData(state) {
      state.globalData = {}
    },
    setContentData(state, data) {
      state.contentData = { ...state.contentData, ...data }
    },
    resetContentData(state) {
      state.contentData = {}
    },
    transitionName(state, name) {
      state.transitionName = name
    },
    setLoginUrl(state, name) {
      state.loginUrl = name
    }
  },
  actions: {
    setLoginUrl({ commit }, status) { commit('setLoginUrl', status) }
  }
}

export default globalModules
